<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    <title>函数作为参数传递 | Sailing | Sailing&#39;s Home</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="cpp">
    <meta name="description" content="1.普通函数体现：一个函数作为另外一个函数的参数，进行函数传递，当然可以通过这种形式进行函数重载。 方式1：函数类型将函数作为基本类型，形如int a，int 是类型，a是形参；int f(int, int )，int (int ，int)是类型，f是形参；缺点：该种类型的写法太繁琐 #include&amp;lt;i">
<meta name="keywords" content="cpp">
<meta property="og:type" content="article">
<meta property="og:title" content="函数作为参数传递">
<meta property="og:url" content="http://lishangying.github.io/2018/01/10/函数作为参数传递/index.html">
<meta property="og:site_name" content="Sailing">
<meta property="og:description" content="1.普通函数体现：一个函数作为另外一个函数的参数，进行函数传递，当然可以通过这种形式进行函数重载。 方式1：函数类型将函数作为基本类型，形如int a，int 是类型，a是形参；int f(int, int )，int (int ，int)是类型，f是形参；缺点：该种类型的写法太繁琐 #include&amp;lt;iostream&amp;gt; using namespace std;  int add(in">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2018-01-10T15:31:55.377Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="函数作为参数传递">
<meta name="twitter:description" content="1.普通函数体现：一个函数作为另外一个函数的参数，进行函数传递，当然可以通过这种形式进行函数重载。 方式1：函数类型将函数作为基本类型，形如int a，int 是类型，a是形参；int f(int, int )，int (int ，int)是类型，f是形参；缺点：该种类型的写法太繁琐 #include&amp;lt;iostream&amp;gt; using namespace std;  int add(in">
    
        <link rel="alternate" type="application/atom+xml" title="Sailing" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">Sailing</h5>
          <a href="mailto:18810691321@163.com" title="18810691321@163.com" class="mail">18810691321@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                Archives
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                Tags
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                Categories
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://lishangying.github.io" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">函数作为参数传递</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">函数作为参数传递</h1>
        <h5 class="subtitle">
            
                <time datetime="2018-01-10T14:50:28.000Z" itemprop="datePublished" class="page-time">
  2018-01-10
</time>


            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#1-普通函数"><span class="post-toc-number">1.</span> <span class="post-toc-text">1.普通函数</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#方式1：函数类型"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">方式1：函数类型</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#方式2：函数指针"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">方式2：函数指针</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#方式3：定义新类型"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">方式3：定义新类型</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#应用实例"><span class="post-toc-number">1.4.</span> <span class="post-toc-text">应用实例</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#2-类成员函数"><span class="post-toc-number">2.</span> <span class="post-toc-text">2. 类成员函数</span></a></li></ol>
        </nav>
    </aside>
    
<article id="post-函数作为参数传递"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">函数作为参数传递</h1>
        <div class="post-meta">
            <time class="post-time" title="2018-01-10 22:50:28" datetime="2018-01-10T14:50:28.000Z"  itemprop="datePublished">2018-01-10</time>

            


            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h4 id="1-普通函数"><a href="#1-普通函数" class="headerlink" title="1.普通函数"></a>1.普通函数</h4><p><strong>体现</strong>：<strong><em>一个函数作为另外一个函数的参数，进行函数传递，当然可以通过这种形式进行函数重载。</em></strong></p>
<h5 id="方式1：函数类型"><a href="#方式1：函数类型" class="headerlink" title="方式1：函数类型"></a><strong>方式1：</strong>函数类型</h5><p>将函数作为基本类型，形如int a，int 是类型，a是形参；int f(int, int )，int (int ，int)是类型，f是形参；<br>缺点：该种类型的写法太繁琐</p>
<pre><code class="cpp"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;

<span class="function"><span class="keyword">int</span> <span class="title">add</span><span class="params">(<span class="keyword">int</span> a,<span class="keyword">int</span> b)</span></span>{
    <span class="keyword">return</span> a+b;
}

int F(int f(int,int),int a,int b){
    <span class="keyword">return</span> f(a,b);
}

<span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span>{
    <span class="built_in">cout</span>&lt;&lt;F(add,<span class="number">1</span>,<span class="number">2</span>)&lt;&lt;<span class="built_in">endl</span>;<span class="comment">//3</span>
}
</code></pre>
<h5 id="方式2：函数指针"><a href="#方式2：函数指针" class="headerlink" title="方式2：函数指针"></a><strong>方式2：</strong>函数指针</h5><p>用typedefine重新定义一种指针，该指针指向类型为int (int ,int)的函数。形参为p<br>注意，函数指针 = 函数名，所以，执行函数的时候，不用解指针！！！</p>
<pre><code class="cpp"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;

<span class="function"><span class="keyword">typedef</span> <span class="title">int</span> <span class="params">(*pf)</span><span class="params">(<span class="keyword">int</span>,<span class="keyword">int</span>)</span></span>; <span class="comment">//</span>

<span class="function"><span class="keyword">int</span> <span class="title">add</span><span class="params">(<span class="keyword">int</span> a,<span class="keyword">int</span> b)</span></span>{
    <span class="keyword">return</span> a+b;
}

<span class="function"><span class="keyword">int</span> <span class="title">F</span><span class="params">(pf p,<span class="keyword">int</span> a,<span class="keyword">int</span> b)</span></span>{<span class="comment">//</span>
    <span class="keyword">return</span> p(a,b);<span class="comment">//</span>
}

<span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span>{
    <span class="built_in">cout</span>&lt;&lt;F(add,<span class="number">1</span>,<span class="number">2</span>)&lt;&lt;<span class="built_in">endl</span>;<span class="comment">//3</span>
}
</code></pre>
<h5 id="方式3：定义新类型"><a href="#方式3：定义新类型" class="headerlink" title="方式3：定义新类型"></a><strong>方式3：</strong>定义新类型</h5><p>用typedefine重新定义一种新类型</p>
<pre><code class="cpp"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;

<span class="function"><span class="keyword">typedef</span> <span class="keyword">int</span> <span class="title">FuncType</span><span class="params">(<span class="keyword">int</span>,<span class="keyword">int</span>)</span></span>; <span class="comment">//定义了FuncType这种函数数据类型</span>

<span class="function"><span class="keyword">int</span> <span class="title">add</span><span class="params">(<span class="keyword">int</span> a,<span class="keyword">int</span> b)</span></span>{
    <span class="keyword">return</span> a+b;
}

<span class="function"><span class="keyword">int</span> <span class="title">F</span><span class="params">(FuncType tf,<span class="keyword">int</span> a,<span class="keyword">int</span> b)</span> </span>{<span class="comment">//</span>
    <span class="keyword">return</span> tf(a,b);<span class="comment">//</span>
}

<span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span></span>{
    <span class="built_in">cout</span>&lt;&lt;F(add,<span class="number">1</span>,<span class="number">2</span>)&lt;&lt;<span class="built_in">endl</span>;<span class="comment">//3</span>
}
</code></pre>
<h5 id="应用实例"><a href="#应用实例" class="headerlink" title="应用实例"></a>应用实例</h5><p>这里运用函数传递实现函数的重载</p>
<pre><code class="cpp"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;</span></span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;


<span class="comment">//三种比较方式</span>
<span class="function"><span class="keyword">int</span> <span class="title">CmpAsc</span><span class="params">(<span class="keyword">int</span> x, <span class="keyword">int</span> y)</span>  </span>
<span class="function"></span>{  
    <span class="comment">//如果x&gt;y返回1，否则返回0；  </span>
    <span class="keyword">if</span>(x&gt;y)<span class="keyword">return</span> <span class="number">1</span>;  
    <span class="keyword">else</span> <span class="keyword">return</span> <span class="number">0</span>;  
}  

<span class="function"><span class="keyword">int</span> <span class="title">CmpDec</span><span class="params">(<span class="keyword">int</span> x, <span class="keyword">int</span> y)</span>  </span>
<span class="function"></span>{  
    <span class="comment">//如果x&lt;y返回1，否则返回0；  </span>
    <span class="keyword">if</span>(x&lt;y)<span class="keyword">return</span> <span class="number">1</span>;  
    <span class="keyword">else</span> <span class="keyword">return</span> <span class="number">0</span>;  
}  

<span class="function"><span class="keyword">int</span> <span class="title">CmpAbsAsc</span><span class="params">(<span class="keyword">int</span> x, <span class="keyword">int</span> y)</span>  </span>
<span class="function"></span>{
    <span class="comment">//如果abs(x)&gt;abs(y)返回1，否则返回0  </span>
    <span class="keyword">if</span>(<span class="built_in">abs</span>(x)&gt;<span class="built_in">abs</span>(y))<span class="keyword">return</span> <span class="number">1</span>;  
    <span class="keyword">else</span> <span class="keyword">return</span> <span class="number">0</span>;  
}  

<span class="comment">//排序</span>
void sort(int a[], int n, int (*cmp)(int,int))  
{   
    <span class="comment">/*对数组a排序，排序原则由cmp指定，若cmp为真，表示两元素逆序*/</span>  
    <span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i&lt;n<span class="number">-1</span>;i++)  
        <span class="keyword">for</span>(<span class="keyword">int</span> j=i+<span class="number">1</span>;j&lt;n;j++)  
            <span class="keyword">if</span>(cmp(a[i],a[j]))  
                swap(a[i],a[j]);  
}  


<span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">void</span>)</span>  </span>
<span class="function"></span>{  
    <span class="keyword">int</span> a[<span class="number">10</span>],i,n;   
    <span class="keyword">int</span> slt;  
    <span class="comment">/*读入n和n个整数，存入数组a*/</span>  
    <span class="built_in">cin</span>&gt;&gt;n;  
    <span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i&lt;n;i++)  
        <span class="built_in">cin</span>&gt;&gt;a[i];  
    <span class="comment">/*读入用户的选择，存入slt; */</span>  

    <span class="built_in">cin</span>&gt;&gt;slt;  
    <span class="keyword">switch</span>(slt)  
    {  
    <span class="keyword">case</span> <span class="number">1</span>:   sort(a, n, CmpAsc); <span class="keyword">break</span>;  
    <span class="keyword">case</span> <span class="number">2</span>:   sort(a, n, CmpDec); <span class="keyword">break</span>;  
    <span class="keyword">case</span> <span class="number">3</span>:   sort(a, n, CmpAbsAsc);<span class="keyword">break</span>;  
    }  
    <span class="comment">/*输出排序后的数组*/</span>  
    <span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i&lt;n;i++)  
    {  
        <span class="keyword">if</span>(i==<span class="number">0</span>)  
            <span class="built_in">cout</span>&lt;&lt;a[i];  
        <span class="keyword">else</span>  
            <span class="built_in">cout</span>&lt;&lt;<span class="string">" "</span>&lt;&lt;a[i];  
    }  
    <span class="built_in">cout</span>&lt;&lt;<span class="built_in">endl</span>;  
    <span class="keyword">return</span> <span class="number">0</span>;  
}
</code></pre>
<h4 id="2-类成员函数"><a href="#2-类成员函数" class="headerlink" title="2. 类成员函数"></a>2. 类成员函数</h4><p>传递普通函数和类的成员函数方式不同：<br>普通函数传的就是函数的实际地址；<br>成员函数在类的内部中没有地址，只能传递在类中的偏移量；<br>当然，可以将成员函数设置为静态函数（static）来当作普通函数来看待。</p>
<pre><code class="cpp"><span class="meta">#<span class="meta-keyword">include</span><span class="meta-string">&lt;iostream&gt;;</span></span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;
<span class="class"><span class="keyword">class</span> <span class="title">ABC</span> {</span>
    <span class="keyword">public</span>:
        <span class="function"><span class="keyword">void</span> <span class="title">f1</span><span class="params">(<span class="keyword">int</span> n, <span class="keyword">int</span> b)</span></span>;
        <span class="function"><span class="keyword">void</span> <span class="title">f2</span><span class="params">(<span class="keyword">int</span> n)</span></span>;
};

<span class="keyword">void</span> ABC::f1(<span class="keyword">int</span> n, <span class="keyword">int</span> b) {
    <span class="built_in">cout</span> &lt;&lt; n &lt;&lt; <span class="string">","</span> &lt;&lt; b &lt;&lt; <span class="built_in">endl</span>;
}

<span class="keyword">void</span> ABC::f2(<span class="keyword">int</span> n) {
    <span class="built_in">cout</span> &lt;&lt; <span class="string">"member function:"</span> &lt;&lt; n &lt;&lt; <span class="built_in">endl</span>;
}

<span class="function"><span class="keyword">void</span> <span class="title">f</span><span class="params">(<span class="keyword">int</span> n)</span> </span>{
     <span class="built_in">cout</span> &lt;&lt; <span class="string">"normal function: "</span> &lt;&lt; n &lt;&lt; <span class="built_in">endl</span>;
}

<span class="comment">// member function</span>
<span class="keyword">template</span> &lt;<span class="class"><span class="keyword">class</span> <span class="title">T</span>&gt;</span>
<span class="class"><span class="title">void</span> <span class="title">cb</span>(<span class="title">T</span> *<span class="title">obj</span>, <span class="title">void</span> (<span class="title">T</span>:</span>:*callback)(<span class="keyword">int</span>), <span class="keyword">int</span> n) {
     (obj-&gt;*callback)(n);
}
<span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">void</span>)</span> </span>{
    ABC *abc = <span class="keyword">new</span> ABC();
    abc-&gt;f1(<span class="number">1</span>, <span class="number">2</span>);
    abc-&gt;f2(<span class="number">3</span>);

    <span class="comment">// invoke normal function</span>
    cb(f, <span class="number">5</span>);

    system(<span class="string">"pause"</span>);
    <span class="keyword">return</span> <span class="number">0</span>;
}
</code></pre>

        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2018-01-10T15:31:55.377Z" itemprop="dateUpdated">2018-01-10 23:31:55</time>
</span><br>


        
    </div>
    <footer>
        <a href="http://lishangying.github.io">
            <img src="/img/avatar.jpg" alt="Sailing">
            Sailing
        </a>
    </footer>
</blockquote>

        


        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/cpp/">cpp</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://lishangying.github.io/2018/01/10/函数作为参数传递/&title=《函数作为参数传递》 — Sailing&pic=http://lishangying.github.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://lishangying.github.io/2018/01/10/函数作为参数传递/&title=《函数作为参数传递》 — Sailing&source=A blog of Sailing" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://lishangying.github.io/2018/01/10/函数作为参数传递/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《函数作为参数传递》 — Sailing&url=http://lishangying.github.io/2018/01/10/函数作为参数传递/&via=http://lishangying.github.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://lishangying.github.io/2018/01/10/函数作为参数传递/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2018/01/12/全局_静态_局部变量的前世今生/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">全局/静态/局部变量的前世今生</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2018/01/01/命名的强制类型转换/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">命名的强制类型转换</h4>
      </a>
    </div>
  
</nav>



    

</article>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>Sailing &copy; 2015 - 2018</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://lishangying.github.io/2018/01/10/函数作为参数传递/&title=《函数作为参数传递》 — Sailing&pic=http://lishangying.github.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://lishangying.github.io/2018/01/10/函数作为参数传递/&title=《函数作为参数传递》 — Sailing&source=A blog of Sailing" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://lishangying.github.io/2018/01/10/函数作为参数传递/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《函数作为参数传递》 — Sailing&url=http://lishangying.github.io/2018/01/10/函数作为参数传递/&via=http://lishangying.github.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://lishangying.github.io/2018/01/10/函数作为参数传递/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: false };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>





</body>
</html>
